package com.etone.smartAudit.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author: 蒋学伟
 * @create: 2020-06-10 14:08:02
 * @Description
 */
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
@TableName(value = "f_audit_exception_month")
public class AuditExceptionMonth implements Serializable {

    @TableId(type = IdType.AUTO, value = "intId")
    private Integer id;

    /**
     * 日期
     */
    @TableField("vcDate")
    private String date;

    /**
     * 城市id
     */
    @TableField("intCityId")
    private Integer cityId;

    /**
     * 城市id
     */
    @TableField("vcCityName")
    private String cityName;

    /**
     * 异常数量
     */
    @TableField("intCnt")
    private Integer cnt;

    /**
     * 类型id
     */
    @TableField("intTypeId")
    private Integer typeId;

    /**
     * 类型名称
     */
    @TableField("vcTypeName")
    private String typeName;

    /**
     * 结论概述
     */
    @TableField("vcRemark")
    private String remark;

    /**
     * 下载次数
     */
    @TableField("intDownloadCnt")
    private Integer downloadCnt;

    /**
     * 表名
     */
    @TableField(exist = false)
    private String tableName;

    /**
     * 本地文件
     */
    @TableField("vcLocalFile")
    private String localFile;

    /**
     * 本地文件
     */
    @TableField("dtLocalFileCreateTime")
    private Date localFileCreateTime;

    /**
     * 文件名称
     *
     * @return
     */
    public String getFileName() {
        return (cityName == null ? "" : cityName) + ((typeName == null ? "" : typeName) + "-") + date;
    }

}
